package cn.lyvust.gui;

import javax.swing.*;

/**
 * GUI编程参考资料
 * https://telcruel.gitee.io/2020/05/14/Java_gui/
 * https://risuxx.github.io/2020/09/04/java-gui/
 *
 */
public class MyGui extends JFrame {
    public MyGui() {
        this.setTitle("Java窗口程序");
        this.setSize(300, 200);
        this.setResizable(false);
        this.setLocationRelativeTo(null);
        //设置自定义布局,否则按钮会被干预,显示位置不符合预期
        this.setLayout(null);
        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        MyGui gui = new MyGui();
    }
}
